<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>

<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="list" checkbox="false" fitColumns="true"
  	 title="上传预习资料" actionUrl="dictTeachItemController.do?datagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="编号"  field="itemNo"  hidden="false"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="项目名称"  field="itemName"  hidden="false" query="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="实验报告模板"  field="templetId"  hidden="false" query="false" queryMode="single"  width="120" formatterjs="function(v,rec){return v==''? '未上传':'已上传'}"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
   <t:dgFunOpt title="上传实验报告模板" funname="uploadTemplet(id)" exp="templetId#empty#true"/>
   <t:dgFunOpt title="编辑实验报告模板" funname="uploadTemplet(id)" exp="templetId#empty#false"/>
   <t:dgFunOpt title="上传预习资料" funname="updatePreview(id)"></t:dgFunOpt>
  </t:datagrid>
  </div>
 </div>
 <script>
 	function uploadTemplet(id){
 		$.dialog({
		  	id:'xxx',
			content: 'url:teachItemPreviewController.do?goTempletAdd&id='+id,
			lock : true,
			zIndex: getzIndex(), 
			parent:frameElement.api,
			width:450,
			height:100,
			title:'上传实验报告模板', 
			opacity : 0.3,
			cache:false,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
	    	 	$('#btn_sub', iframe.document).click(); 
		    	 return false;
		    },
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
 	}
 	function updatePreview(id){
 		$.dialog({
		  	id:'xxx',
			content: 'url:teachItemPreviewController.do?goAdd&id='+id,
			lock : true,
			zIndex: getzIndex(), 
			parent:frameElement.api,
			width:800,
			height:500,
			title:'上传预习资料', 
			opacity : 0.3,
			cache:false,
		    ok: false,
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
 	}
 </script>